package com.mmy.fta.trade.server.dao;

import com.mmy.fta.trade.server.entity.OrderEntity;

import java.util.Date;
import java.util.List;

/**
 * @author qiang.lin
 * @since 2021/10/26
 */
public interface OrderDao {
    List<OrderEntity> queryTransportOrderByDriver(String openId);

    List<OrderEntity> queryTransportOrderByShipper(String consignorOpenId);

    List<OrderEntity> queryCanceledOrdersByDriver(String carrierOpenId);

    List<OrderEntity> queryCanceledOrdersByShipper(String consignorUserId);

    List<OrderEntity> queryCompletedOrdersByDriver(String carrierOpenId);

    List<OrderEntity> queryCompletedOrdersByShipper(String consignorUserId);


    int agreeOrderByShipper(String orderNumber, Date shipperAgreeTime, Date updateTime);

    int refuseOrderByShipper(String orderNumber,Date shipperRefuseTime, Date updateTime);

    int cancelOrderByShipper(String orderNumber, Date shipperCancelTime, Date updateTime);

    int cancelOrderByDriver(String orderNumber, Date driverCancelTime, Date updateTime);

    int receiveOrderByShipper(String orderNumber, Date shipperReceiveTime, Date dealTime, Date updateTime);

    int loadOrderByDriver(String orderNumber, Date driverLoadTime, Date updateTime);

    int unloadOrderByDriver(String orderNumber, Date driverUnloadTime, Date updateTime);

    int insertSelective(OrderEntity record);

    String selectCargoIdByOrderNumber(String orderNumber);

    int insert(OrderEntity orderEntity);

    OrderEntity queryOrderDetail(String orderNumber);

    int republishCargo(String cargoId,Date updateTime);
}
